#define _CRT_SECURE_NO_WARNINGS
#include <string.h>
int percentageLetter(char* s, char letter) {
	int cnt = 0;
	int len = strlen(s);
	while (*s)
	{
		if (*s == letter)
		{
			cnt++;
		}
		s++;
	}
	return cnt * 100 / len;
}
#include <stdio.h>
int main()
{
	char letter;
	char s[30] = { 0 };
	scanf("%s %c", s, &letter);
	printf("%d",percentageLetter(s, letter));
	return 0;
}